package com.example.biz.impl;

import com.example.biz.AnswersBiz;
import com.example.dao.AnswersMapper;
import com.example.entity.Answers;
import com.example.entity.AnswersExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class AnswersBizImpl implements AnswersBiz {
    @Resource
    private AnswersMapper answersMapper;
    @Override
    public List<Answers> queryByTid(int tid) {
        AnswersExample answersExample=new AnswersExample();
        answersExample.createCriteria().andTidEqualTo(tid);
        List<Answers> list=answersMapper.selectByExample(answersExample);
        Collections.shuffle(list);
        return list;
    }
}
